import os
import subprocess
import sys
def print_logo():
    logo = r'''
     ______ _                 _         _   _             _    
    |  ____| |               | |       | | | |           | |   
    | |__  | | ___   ___   __| |   __ _| |_| |_ __ _  ___| | __
    |  __| | |/ _ \ / _ \ / _` |  / _` | __| __/ _` |/ __| |/ /
    | |    | | (_) | (_) | (_| | | (_| | |_| || (_| | (__|   < 
    |_|    |_|\___/ \___/ \__,_|  \__,_|\__|\__\__,_|\___|_|\_\
    '''
    print(logo)

print_logo()

print("\033[1;32;40m[*] Flood_attack 是一种通过发送大量恶意请求或数据包来压倒目标系统的网络攻击类型，导致其资源耗尽，无法正常运行。")
print("\033[1;37;40m")
files = {
    1: {"name": "ddos_cn/Flood_attack/ACK_Flood.py", "description": "ACK Flood（ACK洪水攻击）"},
    2: {"name": "ddos_cn/Flood_attack/DNS_Query_Flood.py", "description": "DNS Query Flood（DNS查询洪水攻击）"},
    3: {"name": "ddos_cn/Flood_attack/ICMP_Flood.py", "description": "ICMP Flood（ICMP洪水攻击）"},
    4: {"name": "ddos_cn/Flood_attack/Ntp_Request_Flood.py", "description": "NTP Request Flood（NTP请求洪水攻击）"},
    5: {"name": "ddos_cn/Flood_attack/UDP_Reflection_Flood.py", "description": "UDP Reflection Flood（UDP反射洪水攻击）"},
    6: {"name": "ddos_cn/Flood_attack/Connection_Flood.py", "description": "Connection Flood（连接洪水攻击）"},
    7: {"name": "ddos_cn/Flood_attack/HTTP_Flood.py", "description": "HTTP Flood（HTTP洪水攻击）"},
    8: {"name": "ddos_cn/Flood_attack/IP_lood.py", "description": "IP Flood（IP洪水攻击）"},
    9: {"name": "ddos_cn/Flood_attack/SYN_Flood.py", "description": "SYN Flood（SYN洪水攻击）"},
    10: {"name": "ddos_cn/Flood_attack/HTTP_Flood_AMT.py", "description": "HTTP Flood Attack on Multiple Targets(HTTP洪水攻击多目标版)"},
    11: {"name": "ddos_cn/Flood_attack/UDP_Flood_AMT.py", "description": "UDP Flood Attack on Multiple Targets(UDP洪水攻击多目标版)"},
    12: {"name": "ddos_cn/Flood_attack/Advanced_IP_Flooding.py", "description": "Advanced IP Flooding（高级IP洪水攻击）"},
    13: {"name": "ddos_cn/Flood_attack/Advanced_HTTP_Flooding.py", "description": "Advanced HTTP Flooding（高级HTTP洪水攻击）"},
    14: {"name": "ddos_cn/Flood_attack/Advanced_ICMP_Flooding.py", "description": "Advanced ICMP Flooding（高级ICMP洪水攻击）"},
    15: {"name": "ddos_cn/Flood_attack/Advanced_DNS_Query_Flood.py", "description": "Advanced DNS Query Flood（高级DNS查询洪水攻击）"},
    16: {"name": "ddos_cn/Flood_attack/Advanced_UDP_Reflection_Flood.py", "description": "Advanced UDP Reflection Flood（高级UDP反射洪水攻击）"},
    17: {"name": "ddos_cn/Flood_attack/Advanced_SYN_Flood.py", "description": "Advanced SYN Flood（高级SYN洪水攻击）"},
    
}

def run_python_file(file_number):
    if file_number in files:
        file_info = files[file_number]
        file_name = file_info["name"]
        file_description = file_info["description"]
        if os.path.exists(file_name) and file_name.endswith('.py'):
            print("ok")
            subprocess.run([sys.executable, file_name])
        else:
            print("错误：文件不存在。")
    else:
        print("错误：无效的选择。")

def main():
    print("请选择攻击模式：")
    for num, file_info in files.items():
        print(f"[{num}] {file_info['description']}")
    choice = int(input("请输入数字："))
    run_python_file(choice)

if __name__ == "__main__":
    main()
    
#sansjtw https://sansjtw.xyz https://github.com/sansjtw